import {
  getlistZGDW,
  getlistZBDJ,
  getWzqf,
  getKflist,
  getYhKflist,
  getlistWZZY,
  getCKlxlist
} from '@/api/biaozhun'
import store from '@/store'
const state = () => ({
  wzlist: [], ///kucunmx/queryKucunGroupbyWuziid
  wzpage: [],///kucunmx/queryKucunmxPage
  kufanglist: [],
  yhkflist: [],
  huoweilist: [],
  zgdwlist: [],
  wuzizylist: [],
  wuziqflist: [],
  chukulxlist: [],
})
const getters = {
  wzlist: (state) => state.wzlist,
  wzpage: (state) => state.wzpage,
  kufanglist: (state) => state.kufanglist,
  yhkflist: (state) => state.yhkflist,
  huoweilist: (state) => state.huoweilist,
  zgdwlist: (state) => state.zgdwlist,
  wuzizylist: (state) => state.wuzizylist,
  wuziqflist: (state) => state.wuziqflist,
  chukulxlist: (state) => state.chukulxlist
}

const mutations = {
  setZgdwList(state, zgdwlist) {
    state.zgdwlist = zgdwlist
  },
  setWzqfList(state, wuziqflist) {
    state.wuziqflist = wuziqflist
  },
  setWzzyList(state, wuzizylist) {
    state.wuzizylist = wuzizylist
  },
  setKuFangList(state, kufanglist) {
    state.kufanglist = kufanglist
  },
  setYhkfList(state, yhkflist) {
    state.yhkflist = yhkflist
  },
  setCklxList(state, chukulxlist) {
    state.chukulxlist = chukulxlist
  }
}
const actions = {
  async setZgdwList({ commit }) {
    let { data } = await getlistZGDW({})
    commit('setZgdwList', data)
  },
  async setWzqfList({ commit }) {
    let { data } = await getWzqf({})
    commit('setWzqfList', data)
  },
  async setWzzyList({ commit }) {
    let { data } = await getlistWZZY({})
    commit('setWzzyList', data)
  },
  async setKuFangList({ commit }, cangkuid) {
    let { data } = await getKflist({ "pageSize": 99999, "cangkuid": cangkuid })
    commit('setKuFangList', data)
  },
  async setYhkfList({ commit }) {
    let { data } = await getYhKflist({})
    commit('setYhkfList', data)
  },
  async setCklxList({ commit }) {
    let { data } = await getCKlxlist({})
    commit('setCklxList', data)
  }
}
export default { state, getters, mutations, actions }
